use ggez::{glam::Vec2, Context};

pub struct Physics {
    pub location: Vec2,
    pub velocity: Vec2,
    pub topspeed: f32,
    pub acceleration: Vec2
}

impl Physics {
    pub fn check_edges(&mut self, ctx: &mut Context) -> () {
        if self.location.x > ctx.gfx.window().inner_size().width as f32 { self.location.x = 0.0}
        else if self.location.x < 0.0 {self.location.x = ctx.gfx.window().inner_size().width as f32}
    
        if self.location.y > ctx.gfx.window().inner_size().height as f32 { self.location.y = 0.0}
        else if self.location.y < 0.0 {self.location.y = ctx.gfx.window().inner_size().height as f32}
    }
}